package com.chry.ocr.controller;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.chry.ocr.service.BookService;

@Controller
@RequestMapping("/book")
public class BookController {
	private static Logger log = Logger.getLogger(BookController.class);
	@Autowired
	private BookService bookService;
	
	
	@RequestMapping("/showBook")
	public String showBook(Model model,@RequestParam(value="id") String id){
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("id", id);
		model.addAttribute("book",bookService.getBookById(map));
		return "hello";
	}
}
